package com.ysd.lis.controller.sys;

import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.service.DictProvinceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "公共资源查询")
@RestController
@RequestMapping("/api/common")
public class CommonController extends BaseController {
    @Autowired
    DictProvinceService dictProvinceService;

    @ApiOperation("查询所有省份")
    @GetMapping("/findDictProvinceList")
    public Result findDictProvinceList(){
        return  dictProvinceService.findDictProvinceList();
    }

    @ApiOperation("根据省份编码查询地市")
    @GetMapping("/findDictCityList")
    public Result findDictCityList(@RequestParam String provCode){
        return  dictProvinceService.findDictCityList(provCode);
    }
    @ApiOperation("根据地市查询区县")
    @GetMapping("/findDictAreaList")
    public Result findDictAreaList(@RequestParam String cityCode){
        return  dictProvinceService.findDictAreaList(cityCode);
    }
}
